﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SqlMiM.Common.ViewModel;
using MvvmFoundation.Wpf;

namespace SqlMiM.SqlIndexes.Options
{
    public class ViewModel : ObservableObject
    {
        private bool isSystemDatabasesEnabled;


        /// <summary>
        /// Get if we must present Systems Databases fragmented indexes.
        /// </summary>
        public bool IsSystemDatabasesEnabled
        {
            get
            {
                return isSystemDatabasesEnabled;
            }
            set
            {
                isSystemDatabasesEnabled = value;
                this.RaisePropertyChanged("IsSystemDatabasesEnabled");
            }
        }

        private int maxIndexes;

        /// <summary>
        /// Max indexes to get, per database
        /// </summary>
        public int MaxIndexes
        {
            get { return maxIndexes; }
            set
            {
                maxIndexes = value;
                this.RaisePropertyChanged("MaxIndexes");
            }
        }


        private Int32[] maxIndexesAvailables = new int[] { 10, 20, 30, 50, 100, 200, 500, 1000 };
        public Int32[] MaxIndexesAvailables
        {
            get
            {
                return maxIndexesAvailables;
            }
        }

        private byte avgPercentFragmentation;


        /// <summary>
        /// Percentage fragmentation minimum to get
        /// </summary>
        public byte AvgPercentFragmentation
        {
            get { return avgPercentFragmentation; }
            set {
                avgPercentFragmentation = value;
                this.RaisePropertyChanged("AvgPercentFragmentation");
            }
        }


        private byte timeoutMax;

        /// <summary>
        /// Max Timeout to wait until stop
        /// </summary>
        public byte TimeoutMax
        {
            get { return timeoutMax; }
            set { 
                timeoutMax = value;
                this.RaisePropertyChanged("TimeoutMax");
            }
        }
    }
}
